import hyRequest from '@/service'

/** 用户的网络请求*/
export function postUserListData(queryInfo: any) {
  return hyRequest.post({
    url: '/users/list',
    data: queryInfo
  })
}

/** 用户删除操作：id<10的用户不允许删除*/
export function delUserById(id: number) {
  return hyRequest.delete({
    url: `/users/${id}`
  })
}

/**
 * 创建用户
 */
export function newUserData(userInfo: any) {
  return hyRequest.post({
    url: '/users',
    data: userInfo
  })
}

/**
 * 编辑用户
 */
export function upDateUserData(id: number, userInfo: any) {
  return hyRequest.patch({
    url: `/users/${id}`,
    data: userInfo
  })
}
